package com.itqf.sms.controller;

import com.itqf.sms.dto.BillDto;
import com.itqf.sms.pojo.Bill;
import com.itqf.sms.service.BillService;
import com.itqf.sms.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.Bidi;

/**
 * projectName: qk_javaproject
 *
 * @author: 肖成扬
 * time: 2021/9/8 14:52
 * description:
 */
@RestController
@CrossOrigin
@RequestMapping("bill")
public class BillController {
    @Autowired
    private BillService billService;
    @GetMapping("providers")
    public Object providers(){
        R r=billService.providers();
        return r;
    }
    @GetMapping("list")
    public Object list(BillDto billDto){
        R r =billService.list(billDto);
        return r;
    }
   @PostMapping("save")
   public Object save( @RequestBody Bill bill){
       R r=billService.save(bill);
       return r;
   }

    @PostMapping("update")
    public Object update(@RequestBody Bill bill){
        R r=billService.update(bill);
        return  r;
    }
    @PostMapping("delete")
    public Object show(int bid){
        R r=billService.delete(bid);
        return r;
    }

}
